(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



BeginPackage["Indices`"];

nPTCDIc8::usage="nPTCDIc8[\[Omega]] gets complex refractive index of PTCDI-\!\(\*SubscriptBox[\(C\), \(8\)]\) with \[Omega] in \!\(\*SuperscriptBox[\(cm\), \(-1\)]\).  Valid in the ranges 1501 < \[Omega] < 3498 and 9091 < \[Omega] < 40000.  Determined from spectroscopic ellipsometry of vapor deposited thin films."
nSiO2::usage="nSiO2[\[Omega]] gets complex refractive index of silica with \[Omega] in \!\(\*SuperscriptBox[\(cm\), \(-1\)]\).  Valid in the range 1492 < \[Omega] < 47619. http://www.seas.ucla.edu/~pilon/Publications/AO2007-1.pdf  Equation 20"
nSi::usage = "nSi[\[Omega]] gets complex refractive index of silicon with \[Omega] in \!\(\*SuperscriptBox[\(cm\), \(-1\)]\).  Valid in the ranges 909 < \[Omega] < 6000 and 6000 \[LessEqual] \[Omega] \[LessEqual] 40000."

Begin["`Private`"];
SetDirectory[DirectoryName[$InputFileName]];


mIRnkData=Import[FindFile[(*Directory[],*)"n_ptcdi-c8_1500-3500cm-1.txt"],"Table"];(*PDIc8 genosc 1500-3500 1/cm  table of values*)
nPTCDIc8mIR=Interpolation[mIRnkData[[4;;,1;;2]](*,InterpolationOrder\[Rule]2*)];(*Argument in cm^-1*)
kPTCDIc8mIR=Interpolation[mIRnkData[[4;;,{1,3}]](*,InterpolationOrder\[Rule]2*)];(*Argument in cm^-1*)

VISnkData=Import[(*ToFileName*)FindFile[(*Directory[],*)"n_ptcdi-c8_250-1100nm.txt"],"Table"];
nPTCDIc8VIS=Interpolation[(VISnkData[[4;;,1;;2]])];(*Argument in nm*)
kPTCDIc8VIS=Interpolation[(VISnkData[[4;;,{1,3}]])];(*Argument in nm*)

nPTCDIc8[\[Omega]_?NumberQ]:=nPTCDIc8[\[Omega]]=Piecewise[{{nPTCDIc8VIS[10^7/\[Omega]]+I kPTCDIc8VIS[10^7/\[Omega]],9091<\[Omega]<40000},{nPTCDIc8mIR[\[Omega]]+I kPTCDIc8mIR[\[Omega]],1501<\[Omega]<3498}}](*\[Omega] in cm^-1*)


nSiO2Vis2[\[Lambda]_]:=Sqrt[1+(0.6961663 \[Lambda]^2)/(\[Lambda]^2-0.0684043)+(0.4079426 \[Lambda]^2)/(\[Lambda]^2-(0.1162414)^2)+(0.8974794 \[Lambda]^2)/(\[Lambda]^2-(9.896161)^2)](*\[Lambda] in microns 0.210-6.7\[Mu]m*)(*http://www.seas.ucla.edu/~pilon/Publications/AO2007-1.pdf  Equation 20*)
nSiO2[\[Omega]_?NumberQ]:=nSiO2[\[Omega]]=Piecewise[{{nSiO2Vis2[10^4/\[Omega]],1492<\[Omega]<47619}}](*\[Omega] in cm^-1*)


Block[{h=4.135668*10^-15 (*eV s*),
c=2.998*10^17 (*nm/s*)},
Clear[nSi,nkSiData,\[Eta]Si,\[Kappa]Si];
nkSiData=Import[(*ToFileName*)FindFile[(*Directory[],*)"n_Si_0.2-6.6eV.txt"],"Table"];(*Argument in eV, complex dielectric constant*)
\[Eta]Si=Interpolation[(nkSiData[[4;;,1;;3]])/.{a_,re_,im_}->{ ((c h)/a),Re@Sqrt[re+I  im]}](*Argument in nm, \[Eta]*);
\[Kappa]Si=Interpolation[(nkSiData[[4;;,1;;3]])/.{a_,re_,im_}->{ ((c h)/a),Im@Sqrt[re+I im]}](*Argument in nm, \[Kappa]*);]

nSiIR[\[Lambda]_]:=\[Sqrt](1+(10.6684293*\[Lambda]^2)/(\[Lambda]^2-0.301516485^2)+(0.003043475\[Lambda]^2)/(\[Lambda]^2-1.13475115^2)+(1.54133408\[Lambda]^2)/(\[Lambda]^2-1104.0^2))(*\[Lambda] in microns 1.36-11.0\[Mu]m*)
nSi[\[Omega]_?NumberQ]:=nSi[\[Omega]]=Piecewise[{{nSiIR[10^4/\[Omega]],909<\[Omega]<6000},{\[Eta]Si[10^7/\[Omega]]+I  \[Kappa]Si[10^7/\[Omega]],6000<=\[Omega]<=40000}}](*\[Omega] in cm^-1*)

ResetDirectory[];
End[];
EndPackage[];
